package gaml.java.serializer;

import gaml.error.GamlException;
import gaml.java.ClassSerializer;
import gaml.yaml.EmptyNode;
import gaml.yaml.YamlNode;
import gaml.yaml.ahchor.YamlAnchorCodeStore;
import gaml.yaml.ahchor.YamlAnchorObjectStore;



/**
 * serializer for null objects
 * @author shnireck_vi
 *
 */
public class NullSerializer implements ClassSerializer <Object> {

	@Override
	public YamlNode createNode (YamlNode parent) { return new EmptyNode (parent); }

	@Override
	public Object createObject () throws GamlException { return null; }

	@Override
	public Class <Object> getObjectClass () { return null; }

	@Override
	public boolean noAnchor () { return true; }

	@Override
	public Object restore (YamlNode node, Object object, YamlAnchorCodeStore anchors) throws GamlException { return null; }

	@Override
	public YamlNode serialize (YamlNode node, Object object, YamlAnchorObjectStore anchors) throws GamlException { return node; }
}
